<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head th:include="include :: header"></head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>会议系统简洁版</title>
<!--background: -webkit-radial-gradient(#3c3c3e, #343436); /* Safari 5.1 - 6.0 */-->
<!--background: -o-radial-gradient(#3c3c3e, #343436); /* Opera 11.6 - 12.0 */-->
<!--background: -moz-radial-gradient(#3c3c3e, #343436); /* Firefox 3.6 - 15 */-->
<!--background: radial-gradient(#3c3c3e, #343436); /* 标准的语法 */-->
<style>
    #body{
        background: url("/img/mettingloginBG.jpg") no-repeat;
        -webkit-background-size: cover;
        background-size: cover;
        /*background-color: #343436;*/
    }
    .m-t-md{margin-top: 50px;text-align: center;color:#fff;}
    .formBox{margin-top: 120px;background-color: rgba(255,255,255,0.2);padding: 20px;border-radius: 4px;-webkit-border-radius: 4px;}
    .form-group{} .phoneBox{position: relative;}
    .errorPhone{color:#ff0000;visibility: hidden}
    #phone{background-color: rgba(0,0,0,0);border: 0; border-bottom: 2px solid #fff;color: #fff;}
    .btn{color:#343436;background-color: #FDCF3B;}
</style>
<body id="body">
<div class="container">
    <h2 class="m-t-md">会议系统简洁版</h2>
    <div class="formBox">
        <form id="signupForm">
            <div class="form-group phoneBox">
                <input id="phone" name="phone" class="form-control" type="tel" placeholder="请输入手机号码"  maxlength="11" autocomplete="off">
                <p class="errorPhone">请输入正确格式的手机号码</p>
            </div>
        </form>
        <div class="bottomBtnGroup">
            <button type="button" class="btn btn-block" onclick="submitHandler()">登录</button>&nbsp;
            <button type="button" class="btn btn-block" onclick="zhuce()">注册</button>&nbsp;
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
    var prefix = ctx + "system/meetingSystem"
    $("#signupForm").validate({
        rules:{
            phone:{
                required:true,
                minlength: 11,
                digits:true
            },
        },
        focusCleanup: true
    });
    function submitHandler() {
        if ($.validate.form()) {
            /*    $.operate.save(prefix + "/addMerting", $('#form-meetingSystem-add').serialize());*/
            btnSubmit();
        }
    }

    function zhuce() {
        location.href=  prefix+"/add"
    }

    function btnSubmit() {
        var phone =	$("input[name='phone']").val();
        var shou = phone.length;
        if (shou!=11){
            $(".errorPhone").fadeIn();
            setTimeout(function () {
                $(".errorPhone").fadeOut();
            },2000)
        }else {
         /*   location.href= prefix +"system/meetingSystem/chaxun?phone="+phone;*/
            $.ajax({
                type :'POST',
                url :prefix + "/chaxun",
                data :{ "phone": phone },
                async : false,
                 success : function(re) {
                    if (re.code==1){
                        layer.open({
                            type: 0,
                            content: '您输入的手机号码不存在,请先注册',
                            yes: function(index, layero){
                                //  刷新当前页面
                                window.location.reload();
                                layer.close(index);
                            }
                        });
                    }else{
                        location.href=  prefix+"/bo"
                    }
                  }
            });

        }
    }

</script>
</body>
</html>